<?php

if (isset($_REQUEST['c'])) {

	require 'PUBLIC.php';

	$c = $_REQUEST['c'];

	$pathClass = 'c/' . $c . '.php';
	if (file_exists($pathClass)) {
		require $pathClass;
		$claObj = new $c();
		if (isset($_REQUEST['f'])) {
			$f = $_REQUEST['f'];
			if (method_exists($claObj, $f)) {
				$claObj->$f();
			} else {
				echo 'function ' . $f . ' not exists';
			}
		} else {
			echo 'no action ';
		}
	} else {
		echo 'class ' . $c . ' not exists at ' . __file__ . ' ' . __line__;
	}
} else {
	echo __file__ . '<hr/>' . __line__;
}
	
/*
	//主函数
	function main(){
		if( isset($_REQUEST['c']) ){
			
			require 'PUBLIC.php';
			
			$c=$_REQUEST['c'];
			
			$pathClass='c/'.$c.'.php';
			if(file_exists($pathClass)){
				require $pathClass ;
				$claObj=new $c();
				if(isset($_REQUEST['f'])){
					$f=$_REQUEST['f'];
					if(method_exists($claObj,$f)){
						$claObj->$f();
					}else{
						echo 'function '. $f.' not exists';
					}
				}else{
					echo 'no action ';
				}
			}else{
				echo 'class '. $c.' not exists at '.__file__.' '.__line__;
			}
			
		}else{
			echo __file__.'<hr/>'.__line__;
		}
	}
	main();
	
*/